<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>SILVERCODERS DocToText: doctotext::Exception Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">SILVERCODERS DocToText
   &#160;<span id="projectnumber">4.0.1512</span>
   </div>
   <div id="projectbrief">Converts DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML and HTML documents to plain text. Extracts metadata and annotations.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>doctotext</b></li><li class="navelem"><a class="el" href="classdoctotext_1_1Exception.html">Exception</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classdoctotext_1_1Exception-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">doctotext::Exception Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="exception_8h_source.html">exception.h</a>&gt;</code></p>
<div class="dynheader">
Inheritance diagram for doctotext::Exception:</div>
<div class="dyncontent">
 <div class="center">
  <img src="classdoctotext_1_1Exception.png" usemap="#doctotext::Exception_map" alt=""/>
  <map id="doctotext::Exception_map" name="doctotext::Exception_map">
</map>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a5db39ff707c5408549a705136c760a4b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoctotext_1_1Exception.html#a5db39ff707c5408549a705136c760a4b">Exception</a> (const std::string &amp;first_error_message)  throw ()</td></tr>
<tr class="separator:a5db39ff707c5408549a705136c760a4b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae10dd7e1e1567a4b3fe2a0e105dd8c5b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae10dd7e1e1567a4b3fe2a0e105dd8c5b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Exception</b> (const <a class="el" href="classdoctotext_1_1Exception.html">Exception</a> &amp;ex)  throw ()</td></tr>
<tr class="separator:ae10dd7e1e1567a4b3fe2a0e105dd8c5b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8409e8467bfa6309dc6e6f2dc3219e12"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8409e8467bfa6309dc6e6f2dc3219e12"></a>
<a class="el" href="classdoctotext_1_1Exception.html">Exception</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classdoctotext_1_1Exception.html">Exception</a> &amp;ex)  throw ()</td></tr>
<tr class="separator:a8409e8467bfa6309dc6e6f2dc3219e12"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a32cb3156f2adfd140c0bb5b6cd7ad78f"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a32cb3156f2adfd140c0bb5b6cd7ad78f"></a>
const char *&#160;</td><td class="memItemRight" valign="bottom"><b>what</b> ()</td></tr>
<tr class="separator:a32cb3156f2adfd140c0bb5b6cd7ad78f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab88499ca7184b914041eed0a38c82b9f"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoctotext_1_1Exception.html#ab88499ca7184b914041eed0a38c82b9f">getBacktrace</a> ()</td></tr>
<tr class="separator:ab88499ca7184b914041eed0a38c82b9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac612f8be8b7c1d0f86f9bc33548f37c2"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoctotext_1_1Exception.html#ac612f8be8b7c1d0f86f9bc33548f37c2">appendError</a> (const std::string &amp;error_message)</td></tr>
<tr class="separator:ac612f8be8b7c1d0f86f9bc33548f37c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48a13fbb9923cfa41dbde8a5b32a6b46"><td class="memItemLeft" align="right" valign="top">std::list&lt; std::string &gt;::iterator&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoctotext_1_1Exception.html#a48a13fbb9923cfa41dbde8a5b32a6b46">getErrorIterator</a> () const </td></tr>
<tr class="separator:a48a13fbb9923cfa41dbde8a5b32a6b46"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22f660e0d2a40bba5721d18448c63652"><td class="memItemLeft" align="right" valign="top">size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classdoctotext_1_1Exception.html#a22f660e0d2a40bba5721d18448c63652">getErrorCount</a> () const </td></tr>
<tr class="separator:a22f660e0d2a40bba5721d18448c63652"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>This class is implementation of std::exception, which is used by DocToText. In this implementation, errors can be formed in "stack".</p>
<p>In order to create exception just call: </p>
<div class="fragment"><div class="line"><span class="keywordflow">throw</span> Exception(<span class="stringliteral">&quot;First error&quot;</span>);</div>
</div><!-- fragment --><p>You can catch exception and add one more error: </p>
<div class="fragment"><div class="line"><span class="keywordflow">catch</span> (Exception&amp; ex)</div>
<div class="line">{</div>
<div class="line">    ex.appendError(<span class="stringliteral">&quot;Next error message&quot;</span>);</div>
<div class="line">    <span class="keywordflow">throw</span>;</div>
<div class="line">}</div>
</div><!-- fragment --><p>or you can catch exception and get "backtrace": </p>
<div class="fragment"><div class="line"><span class="keywordflow">catch</span> (Exception&amp; ex)</div>
<div class="line">{</div>
<div class="line">    std::cerr &lt;&lt; ex.getBacktrace();</div>
<div class="line">}</div>
</div><!-- fragment --> </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a5db39ff707c5408549a705136c760a4b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">doctotext::Exception::Exception </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>first_error_message</em></td><td>)</td>
          <td></td>
        </tr>
        <tr>
          <td align="right">throw </td><td>(</td><td colspan="2"></td>
        </tr>
        <tr>
          <td align="right"></td><td>)</td><td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>The constructor. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">first_error_message</td><td>first error message (gives information about cause of an error). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="ac612f8be8b7c1d0f86f9bc33548f37c2"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void doctotext::Exception::appendError </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>error_message</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Adds one more error message. </p>

</div>
</div>
<a class="anchor" id="ab88499ca7184b914041eed0a38c82b9f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::string doctotext::Exception::getBacktrace </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>returns a string with all error messages. Each error message is separated by "\n". Suppose we have thrown an exception: </p>
<div class="fragment"><div class="line"><span class="keywordflow">throw</span> Exception(<span class="stringliteral">&quot;First error message&quot;</span>);</div>
</div><!-- fragment --><p> Next, we have added one more error: </p>
<div class="fragment"><div class="line">ex.appendError(<span class="stringliteral">&quot;Second error message&quot;</span>);</div>
</div><!-- fragment --><p> In the result getBacktrace will return a string: "First error message\nSecond error message\n" </p>

</div>
</div>
<a class="anchor" id="a22f660e0d2a40bba5721d18448c63652"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">size_t doctotext::Exception::getErrorCount </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns a number of error messages </p>

</div>
</div>
<a class="anchor" id="a48a13fbb9923cfa41dbde8a5b32a6b46"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::list&lt;std::string&gt;::iterator doctotext::Exception::getErrorIterator </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>returns a iterator to the first error message </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="exception_8h_source.html">exception.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
